package com.github.zxhtom.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.zxhtom.mapper.AccountDao;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.github.zxhtom.pojo.Account;

@Service
public class AccountService{

    @Resource
    private AccountDao accountDao;

    public int insert(Account pojo){
        return accountDao.insert(pojo);
    }

    public int insertSelective(Account pojo){
        return accountDao.insertSelective(pojo);
    }

    public Account login(Account account){
        return accountDao.login(account);
    }

    public int insertList(List<Account> pojos){
        return accountDao.insertList(pojos);
    }

    public int update(Account pojo){
        return accountDao.update(pojo);
    }

    public Object test() {
        PageHelper.startPage(1, 2);
        return new PageInfo<>(accountDao.selectAll()).getList();
    }
}
